#ifndef XMLREADER_H
#define XMLREADER_H

#include "SessionData.h"
#include "SdpData.h"

#include <QtXml/QDomDocument>
#include <QtXml/QDomElement>
#include <QtXml/QDomNodeList>
#include <QtXml/QDomNode>
#include <QtCore/QFile>
#include <string>


class XmlReader
{
public:
	// Constructor & Destructor

	XmlReader();
	virtual ~XmlReader();

	// Memberfunctions 

	void initialize();
	void cleanup();

	void parseConfigFile(std::string file, SessionData & data);
	void parseCodecFile(std::string file, SdpData & data);

private:
	// Memberfunctions

	void parseSession(QDomNodeList list, SessionData & data);
	void parseSettings(QDomNodeList list, SessionData & data);
	void parseContacts(QDomNodeList list, SessionData & data);
	void parseContact(QDomNodeList list, SessionData & data);

	void parseCodecs(QDomNodeList list, SdpData & data);
	void parseCodec(QDomNode node, SdpData & data);
};

#endif